spin_lock(&rd->grant_table->lock);
+ sdom = sha->domid;
+
if ( !act->pin ||
(!(op->flags & GNTMAP_readonly) &&
!(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask))) )
{
sflags = sha->flags;
- sdom = sha->domid;
/*
* This loop attempts to set the access (reading/writing) flags
act->frame = gmfn_to_mfn(rd, sha->frame);
}
}
+ else if ( unlikely(sdom != ld->domain_id) )
+ PIN_FAIL(unlock_out, GNTST_general_error,
+ "Bad domain (%d). (NB. expected dom %d)\n",
+ sdom, ld->domain_id);
else if ( (act->pin & 0x80808080U) != 0 )
PIN_FAIL(unlock_out, ENOSPC,
"Risk of counter overflow %08x\n", act->pin);
spin_lock(&rd->grant_table->lock);
+ sdom = sha->domid;
+
if ( !act->pin ||
(!readonly && !(act->pin & GNTPIN_hstw_mask)) )
{
sflags = sha->flags;
- sdom = sha->domid;
for ( ; ; )
{
act->frame = gmfn_to_mfn(rd, sha->frame);
}
}
+ else if ( unlikely(sdom != current->domain->domain_id) )
+ PIN_FAIL(unlock_out, GNTST_general_error,
+ "Bad domain (%d). (NB. expected dom %d)\n",
+ sdom, current->domain->domain_id);
else if ( (act->pin & 0x80808080U) != 0 )
PIN_FAIL(unlock_out, ENOSPC,
"Risk of counter overflow %08x\n", act->pin);